import requests

from common.token_util import TokenUtil


class EmpUtil:
    @classmethod
    def emp_id_util(cls):
        url="http://ihrm2-test.itheima.net/api/company/department"
        header={"Content-Type":"application/json","Authorization":TokenUtil.get_token()}
        body = {"name": "test001", "code": "12345"}
        resp=requests.post(url=url,headers=header,json=body)
        emp_id=resp.json().get('data').get('id')
        return emp_id


if __name__ == '__main__':
    print(EmpUtil.emp_id_util())